<template>
  <div class="page-container">
    <Step4 ref="step4" :industry-code="industryCode" :form-detail="siteList" />
    <Step2 ref="step2" :form-detail="detail" />
    <Step3 ref="step3" :form-detail="detail" />
  </div>
</template>

<script>
import Step4 from '@/components/Approve/Step4.vue'
import Step2 from '@/components/Approve/Step2.vue'
import Step3 from '@/components/Approve/Step3.vue'
import { getEnterpriseDetail } from '@/api/enterprise'
export default {
  name: 'EnterpriseDetail',
  components: {
    Step4,
    Step2,
    Step3
  },
  data() {
    return {
      id: '',
      industryCode: '',
      detail: {},
      siteList: []
    }
  },

  created() {
    const { id, industryCode } = this.$route.query
    this.id = id
    this.industryCode = industryCode
    this.getDetail()
  },

  methods: {

    // 获取详情
    getDetail() {
      const data = {
        id: this.id
      }
      getEnterpriseDetail(data).then(res => {
        this.detail = res || {}
        this.siteList = this.detail.siteResps || []
      }).catch(() => {})
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
